#pragma once
#include "vector3.h"
#include "vector4.h"
#include <math.h>

class quaternion: public vector4
{
public:
	quaternion(void);
	quaternion(double d, double a, double b, double c);
	quaternion(double angle, vector3 axis);
	~quaternion(void);

	double length();
	
	quaternion normalize();
	quaternion normalized();
	quaternion conjugate();
	vector3 getVector();

	quaternion operator+ (const quaternion &rhs);
	quaternion operator* (const quaternion &rhs);
	quaternion operator* (const double &s);
	quaternion operator/ (const double &s);
	quaternion& operator+= (const quaternion &rhs);
	quaternion& operator-= (const quaternion &rhs);
	
	static vector3 rotate(vector3 vector, quaternion rotation);
	static quaternion rotate(quaternion orientation, quaternion rotation);

	double* toMatrix(bool normalized);
};